from jieba.analyse import TFIDF

# 获取案例文本内容
demo_file_path = "demo.txt"
content = open(demo_file_path, "rb").read()

# 创建TFIDF对象
tf_idf = TFIDF()

# 加载idf文件
tf_idf.set_idf_path("./idf.txt.big")

# 获取关键词top10
keywords = tf_idf.extract_tags(content, topK=10)
print(", ".join(keywords))
